The present invention relates to computer disk storage. More specifically, the invention relates to the creation and maintenance of logical volumes used in system crash recovery and the like.
A xe2x80x9csnapshotxe2x80x9d is essentially a logical copy of the information stored on a volume at a particular instant in time. A snapshot may be used like a backup copy of the volume, but is much faster to create than a full backup. As used herein, a xe2x80x9cbase volumexe2x80x9d is the actual volume of which the snapshot was taken. A snapshot system uses a differential file to track the changes written to the base volume after the snapshot is captured. If multiple snapshots are taken over time, a differential file exists for each snapshot.
To maintain the snapshot data, when a change is written to an allocation unit (e.g., a cluster) that was in use at the time of the snapshot, the original data is copied from the allocation unit to the differential file before writing the new data. This method is often referred to as xe2x80x9ccopy-on-write.xe2x80x9d In this way, the state (i.e., snapshot) of the base volume at the time the snapshot was taken is accessible by reading current data from the base volume in conjunction with any data stored in the differential file associated with the snapshot.
In systems having multiple volumes, data or files may be distributed across more than one volume. Some programs may maintain large data files on one volume and log files on another volume. Many of those programs include the capability to recover the data and log files in the event of a system crash, but only if the crash occurred simultaneously across all affected volumes. However, existing snapshot systems do not have the ability to coordinate snapshot sets across multiple volumes so that crash recovery software or the like can reliably reconstruct related files distributed across those multiple volumes.
An efficient mechanism for coordinating snapshots across multiple volumes has eluded those skilled in the art.
The present invention provides a snapshot system capable of capturing snapshots of multiple volumes with each snapshot being coordinated. The snapshot system includes a coordinator mechanism, such as a filter driver, below the file system and above the volume manager for each volume. In operation, a snapshot manager determines which volumes are to be involved in a snapshot operation, and issues a message to the file system for each volume involved. Each of those messages includes information identifying the volumes involved in the snapshot operation. Preferably, the message causes the file system of each volume to perform functions in preparation for the snapshot operation, such as committing any file system cache operations (e.g., flushing a write cache) and requesting to minimize writes to the volume. In one embodiment, the file system makes its respective volume xe2x80x9cconsistentxe2x80x9d so that no file system check program or log file restart operations need be executed on the snapshotted volume. A xe2x80x9cconsistentxe2x80x9d file system is one in which no file system meta-data is changing. In other words, the file system allows changes to the contents of files but does not allow file or directory creations or growing or shrinking of files. When prepared, each file system passes its respective message down to the coordinator mechanism, and keeps the volume consistent until the message is returned.
The coordinator mechanism recognizes that a snapshot operation across multiple volumes is occurring from the first message passed down from a file system involved. As mentioned, each message identifies the volumes involved. Accordingly, the first message received causes the coordinator mechanism to await a confirmation from each file system involved that its respective volume is ready for the snapshot operation. When the coordinator mechanism has received the confirmation from the file systems involved, the coordinator mechanism begins holding subsequent writes to the volumes, and issues a message to a component responsible for capturing the snapshots in the snapshot set. That component may be a system driver or a hardware mechanism. When the snapshots are captured, the snapshot set will include snapshots that are coordinated across the multiple volumes. The coordinator mechanism then releases the writes being held for the volumes involved, which may then proceed with volume accesses as normal.